package com.jx.lcs.product.entity;


import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * 产品信息 
 */
@Entity
@Table(name = "tc_product_info")
@DynamicInsert
@DynamicUpdate
public class ProductInfo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private String id;				//产品ID 
	
	private String pname;			//产品名称
	
	private String pcode;			//产品编码
	
	private ProductType ptcode;		//产品类型
	
	private Integer investPeriod;	//投资期限
	
	private String periodUnit;		//期限单位

	private BigDecimal totalMoney;	//总金额
	
	private String fullStatus;		//满标状态
	
	private String hotStatus;		//热门产品状态

	private Date beginAgentDay;		//开始代理
	
	private Date endAgentDay;		//停止代理
	
	private Date beginPaymentDay;	//开始打款
	
	private Date endPaymentDay;		//停止贷款

	private Float yearRate;			//年化利率

	private BigDecimal minBuyMoney;	//起投金额

	private String imgUrl;			//产品图片URL
	
	private String detailUrl;		//产品详情URL
	
	private String shareUrl;		//产品分享URL
	
	private Float stepLength;       //步长
	
	private Integer agentUserNum;   //最多代理人数

	private String orderFullStatus;	//预约满额状态
	
	private Integer orderOverTime;
	
	private Integer smsRemaindTime;
	
	public String publishStatus;	//发布状态
	
	private Date recordTime;
	
	private String productType;

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "ID", unique = true, nullable = false)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "PNAME")
	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	@Column(name = "PCODE")
	public String getPcode() {
		return pcode;
	}

	public void setPcode(String pcode) {
		this.pcode = pcode;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PTCODE", referencedColumnName="TYPECODE")
	public ProductType getPtcode() {
		return ptcode;
	}

	public void setPtcode(ProductType ptcode) {
		this.ptcode = ptcode;
	}

	@Column(name = "INVESTPERIOD")
	public Integer getInvestPeriod() {
		return investPeriod;
	}

	public void setInvestPeriod(Integer investPeriod) {
		this.investPeriod = investPeriod;
	}

	@Column(name = "PERIODUNIT")
	public String getPeriodUnit() {
		return periodUnit;
	}

	public void setPeriodUnit(String periodUnit) {
		this.periodUnit = periodUnit;
	}

	@Column(name = "TOTALMONEY")
	public BigDecimal getTotalMoney() {
		return totalMoney;
	}

	public void setTotalMoney(BigDecimal totalMoney) {
		this.totalMoney = totalMoney;
	}

	@Column(name = "FULLSTATUS")
	public String getFullStatus() {
		return fullStatus;
	}

	public void setFullStatus(String fullStatus) {
		this.fullStatus = fullStatus;
	}

	@Column(name = "HOTSTATUS")
	public String getHotStatus() {
		return hotStatus;
	}

	public void setHotStatus(String hotStatus) {
		this.hotStatus = hotStatus;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "BEGINAGENTDAY")
	public Date getBeginAgentDay() {
		return beginAgentDay;
	}

	public void setBeginAgentDay(Date beginAgentDay) {
		this.beginAgentDay = beginAgentDay;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ENDAGENTDAY")
	public Date getEndAgentDay() {
		return endAgentDay;
	}

	public void setEndAgentDay(Date endAgentDay) {
		this.endAgentDay = endAgentDay;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "BEGINPAYMENTDAY")
	public Date getBeginPaymentDay() {
		return beginPaymentDay;
	}

	public void setBeginPaymentDay(Date beginPaymentDay) {
		this.beginPaymentDay = beginPaymentDay;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ENDPAYMENTDAY")
	public Date getEndPaymentDay() {
		return endPaymentDay;
	}

	public void setEndPaymentDay(Date endPaymentDay) {
		this.endPaymentDay = endPaymentDay;
	}

	@Column(name = "YEARRATE")
	public Float getYearRate() {
		return yearRate;
	}

	public void setYearRate(Float yearRate) {
		this.yearRate = yearRate;
	}

	@Column(name = "MINBUYMONEY")
	public BigDecimal getMinBuyMoney() {
		return minBuyMoney;
	}

	public void setMinBuyMoney(BigDecimal minBuyMoney) {
		this.minBuyMoney = minBuyMoney;
	}

	@Column(name = "IMGURL")
	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	@Column(name = "DETAILURL")
	public String getDetailUrl() {
		return detailUrl;
	}

	public void setDetailUrl(String detailUrl) {
		this.detailUrl = detailUrl;
	}

	@Column(name = "SHAREURL")
	public String getShareUrl() {
		return shareUrl;
	}

	public void setShareUrl(String shareUrl) {
		this.shareUrl = shareUrl;
	}

	@Column(name = "STEPLENGTH")
	public Float getStepLength() {
		return stepLength;
	}

	public void setStepLength(Float stepLength) {
		this.stepLength = stepLength;
	}

	@Column(name = "AGENTUSERNUM")
	public Integer getAgentUserNum() {
		return agentUserNum;
	}

	public void setAgentUserNum(Integer agentUserNum) {
		this.agentUserNum = agentUserNum;
	}

	@Column(name = "ORDERFULLSTATUS")
	public String getOrderFullStatus() {
		return orderFullStatus;
	}

	public void setOrderFullStatus(String orderFullStatus) {
		this.orderFullStatus = orderFullStatus;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "RECORDTIME")
	public Date getRecordTime() {
		return recordTime;
	}

	public void setRecordTime(Date recordTime) {
		this.recordTime = recordTime;
	}

	@Column(name = "ORDEROVERTIME")
	public Integer getOrderOverTime() {
		return orderOverTime;
	}

	public void setOrderOverTime(Integer orderOverTime) {
		this.orderOverTime = orderOverTime;
	}

	@Column(name = "SMSREMAINDTIME")
	public Integer getSmsRemaindTime() {
		return smsRemaindTime;
	}

	public void setSmsRemaindTime(Integer smsRemaindTime) {
		this.smsRemaindTime = smsRemaindTime;
	}

	@Column(name = "PUBLISHSTATUS")
	public String getPublishStatus() {
		return publishStatus;
	}

	public void setPublishStatus(String publishStatus) {
		this.publishStatus = publishStatus;
	}

	@Transient
	public String getProductType() {
		return productType;
	}

	public void setProductType(String productType) {
		this.productType = productType;
	}
	
}
